//Global Path                                                                 
clear
cd "D:"
************************************************************************************
* Ou: "Race to the Top: How Competition for Political Power Affects Participation" *
* Note: Commands for generating graphs (based on STATA Version 15)                 * 
* The replication codes are organized by the sequence of Figures.                  *
************************************************************************************

************************************************************************************
*                                    Figure 1                                      *
*                                                                                  *            
*Note: This figure illustrates the equilibrium voting behavior and the likelihood  *
*of Policy B winning. In the Excel file of Figure 1, "Value" means the instrinsic  *
*political values discussed in the paper. "p" is the equlibrium likelihood of a    *
*Group A voter's voting for Policy A, "q" is the equilibrium likelihood of a Group *
*B voter's voting for Policy B. "Election" indicates whether it is Voting Game 1   *
*or Voting Game 2. "Policy B" is the expected likelihood of Policy B winning in    *
*equilibrium situations given specific parameterizations of "Value" "p" and "q".   *
*"Value" is arbitrarily set for illustration purposes.                             *
*"p" "q" and "Policy B" are derived based on the models in Online Appendix A.      *                                                                 *     
************************************************************************************
clear
import excel "Figures.xlsx", sheet("Figure1") firstrow

tw (line p Value if Election==1,name(Figure1a,replace) lwidth(thick) lcolor(gs2) xaxis(1 2) yaxis(1 2))/*
*/||(line q Value if Election==1,lwidth(thick) lpattern(dash) lcolor(gs10))/*
*/||(scatter p Value if Election==1&Value==0,msymbol(Oh) mcolor(gs2) msize(large))/*
*/||(scatter q Value if Election==1&Value==0,msymbol(Oh) mcolor(gs10) msize(large)),/* 
*/xlabel(-3 (3) 3.2) xtitle("") ytitle("Likelihood of Voting",size(6))/* 
*/xtitle("Intrinsic Value",size(6)) ylabel(0 (0.2) 1, nogrid angle(0))/* 
*/ylabel("",axis(2)) xlabel("",axis(2)) xtitle("",axis(2)) ytitle("",axis(2))/* 
*/legend(order(1 2) ring(0) position(11) symxsize(6)  keygap(vsmall)  col(1) label(1 "Group A") label(2 "Group B"))/*
*/title("Panel A: Voting in VG1",color(black))
graph display Figure1a, xsize(5) ysize(5)

tw (line p Value if Election==2,name(Figure1b,replace) lwidth(thick) lcolor(gs2) xaxis(1 2) yaxis(1 2))/*
*/||(line q Value if Election==2,lwidth(thick) lpattern(dash) lcolor(gs10))/*
*/||(scatter p Value if Election==2&Value==0,msymbol(Oh) mcolor(gs2) msize(large))/*
*/||(scatter q Value if Election==2&Value==0,msymbol(Oh) mcolor(gs10) msize(large)),/* 
*/xlabel(-3 (3) 3.2) xtitle("") ytitle("Likelihood of Voting",size(6))/* 
*/xtitle("Intrinsic Value",size(6)) ylabel(0 (0.2) 1, nogrid angle(0))/* 
*/ylabel("",axis(2)) xlabel("",axis(2)) xtitle("",axis(2)) ytitle("",axis(2))/* 
*/legend(order(1 2) ring(0) position(11) symxsize(6) keygap(vsmall)  col(1) label(1 "Group A") label(2 "Group B"))/*
*/title("Panel B: Voting in VG2",color(black)) 
graph display Figure1b, xsize(5) ysize(5)

tw (line PolicyB Value if Election==1,name(Figure1c,replace) lwidth(thick) lcolor(green) xaxis(1 2) yaxis(1 2))/*
*/||(line PolicyB Value if Election==2,lwidth(thick) lcolor(blue))/*
*/||(pcarrowi 0.89 2.5 0.89 2.8 (9) "VG2",color(blue) mlabcolor(blue) barbsize(1.5) mlabsize(4))/*
*/||(pcarrowi 0.29 1.2 0.29 1.5 (9) "VG1",color(green) mlabcolor(green) barbsize(1.5) mlabsize(4))/*
*/||(scatter PolicyB Value if Election==1&Value==0,msymbol(Oh) mcolor(green) msize(large))/*
*/||(scatter PolicyB Value if Election==2&Value==0,msymbol(Oh) mcolor(blue) msize(large)),/* 
*/xlabel(-3 (3) 3.2) xtitle("") ytitle("Expected Prob. Policy B Winning",size(6)) xtitle("Intrinsic Value",size(6))/* 
*/ylabel(0 (0.25) 1, nogrid angle(0)) ylabel("",axis(2)) xlabel("",axis(2)) xtitle("",axis(2)) ytitle("",axis(2))/* 
*/legend(off) title("Panel C: Pr(Policy B Winning)",color(black)) 
graph display Figure1c, xsize(5) ysize(5)

graph combine Figure1a Figure1b Figure1c, name(Figure1,replace) row(1)
graph display Figure1,xsize(12) ysize(5)

************************************************************************************
*                                    Figure 2                                      *
*                                                                                  *            
*Note: This figure illustrates the observed likelihood of participation by group,  *
*treatment, and voting game. All these observations are the results of Experiment 1*
*In the Excel file of Figure 2, "Mean" is the experimental results of the average  *
*participation. "CI95L" is the corresponding lower bound of the 95% confidence     *
*interval. "CI95H" is the corresponding higher bound of the 95% confidence interval*
*"Treatment" is the Treatment that subjects are randomly assigned to               *
*These results are manully collected from statistical analysis.                    *
*Specifically, these results are generated by using the codes from line 34 to line *
*155 in the associated StatisticsAnalysisReplicationCode.do file.                  *       
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("Figure2") firstrow
twoway (bar Mean Position if VotingGames==1&Treatment=="Control",  name(E1,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(bar Mean Position if VotingGames==1&Treatment=="Treatment", fcolor(gs14) bcolor(gs2) lwidth(0.2))/*
*/||(rcap CI95L CI95H Position if VotingGames==1,lcolor(gs2)  yaxis(1) lwidth(0.2)), ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2))/*
*/xlabel(1 `" "Control" "" "' 1.5 `" " " "{bf:Group A}" "' 2 `" "Treatment" "" "'/* 
*/4 `" "Control" "" "' 4.5 `" " " "{bf:Group B}" "' 5 `" "Treatment" "" "' ,axis(1) tlcolor(none))/* 
*/xtick(1 2 4 5,axis(1) tlcolor(black)) xlabel("",axis(2)) ytitle("") xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white)) order(3) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(3 "95% CI"))/*  
*/text(0.04 1 "0.45",place(c) size(5) color(black))/* 
*/text(0.04 2 "0.64",place(c) size(5) color(black))/* 
*/text(0.04 4 "0.23",place(c) size(5) color(black))/* 
*/text(0.04 5 "0.44",place(c) size(5) color(black))/* 
*/text(0.82 1.5 "{&Delta}=0.19",place(c) size(2) color(black))/* 
*/text(0.8 1.5 "p-value=0.004",place(c) size(2) color(black))/* 
*/text(0.62 4.5 "{&Delta}=0.21",place(c) size(2) color(black))/* 
*/text(0.6 4.5 "p-value=0.003",place(c) size(2) color(black)) title("Voting Game 1",color(black))



twoway (bar Mean Position if VotingGames==2&Treatment=="Control",  name(E2,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(bar Mean Position if VotingGames==2&Treatment=="Treatment", fcolor(gs14) bcolor(gs2) lwidth(0.2))/*
*/||(rcap CI95L CI95H Position if VotingGames==2,lcolor(gs2)  yaxis(1) lwidth(0.2)),ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) /*  
*/xlabel(1 `" "Control" "" "' 1.5 `" " " "{bf:Group A}" "' 2 `" "Treatment" "" "'/* 
*/4 `" "Control" "" "' 4.5 `" " " "{bf:Group B}" "' 5 `" "Treatment" "" "' ,axis(1) tlcolor(none))/*
*/xtick(1 2 4 5,axis(1) tlcolor(black))  xlabel("",axis(2)) ytitle("") xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(3) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(3 "95% CI"))/*  
*/text(0.04 1 "0.12",place(c) size(5) color(black))/* 
*/text(0.04 2 "0.34",place(c) size(5) color(black))/* 
*/text(0.04 4 "0.35",place(c) size(5) color(black))/* 
*/text(0.04 5 "0.54",place(c) size(5) color(black))/* 
*/text(0.52 1.5 "{&Delta}=0.22",place(c) size(2) color(black))/*  
*/text(0.5 1.5 "p-value<0.001",place(c) size(2) color(black))/* 
*/text(0.72 4.5 "{&Delta}=0.19",place(c) size(2) color(black))/* 
*/text(0.7 4.5 "p-value=0.007",place(c) size(2) color(black)) title("Voting Game 2",color(black))

graph combine E1 E2, name(Figure2,replace) row(1) l1("Likelihood of Voting")
graph display Figure2, xsize(9) ysize(5)

************************************************************************************
*                                    Figure 3                                      *
*                                                                                  *            
*Note: This figure illustrates the self-reported beliefs elicited in post-treatment*
*survey. Participants value the importance of political participation based on a   *
*scale of 1-9, 1 being not important at all, 5 being neutral, and 9 being extremely*
*important. In the Excel file of Figure 3, "Mean" is the experimental results of   *
*the average valuation of the importance of voting. "CI95L" is the corresponding   *
*lower bound of the 95% confidence interval. "CI95H" is the corresponding higher   *
*bound of the 95% confidence interval. "Treatment" is the Treatment that subjects  *
*are randomly assigned to. "VoterType"=1 means Group A voters' averages;           *
*"VoterType"=2 means Group B voters' averages.                                     *
*These results are manully collected from statistical analysis.                    *                  
*Specifically, these results are generated by using the codes from line 183 to line*
*202 in the associated StatisticsAnalysisReplicationCode.do file.                  *       
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("Figure3") firstrow
twoway (bar Mean Position if VoterType==1,  name(GroupA,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if VoterType==1,lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1))/* 
*/xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)/*  
*/row(3) label(2 "95% CI")) graphregion(color(white)) plotregion(color(white))/*  
*/text(1.5 1 "4.72",place(c) size(8) color(black))/* 
*/text(1.5 2.2 "5.97",place(c) size(8) color(black))/*
*/text(8.2 1.6 "{&Delta}=1.25",place(c) size(2) color(black))/* 
*/text(8 1.6 "p-value=0.002",place(c) size(2) color(black)) title("Group A",color(black))

twoway (bar Mean Position if VoterType==2,  name(GroupB,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if VoterType==2,lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1))/* 
*/xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)/*  
*/row(3) label(2 "95% CI")) graphregion(color(white)) plotregion(color(white))/*  
*/text(1.5 1 "4.75",place(c) size(8) color(black))/* 
*/text(1.5 2.2 "6.17",place(c) size(8) color(black))/*
*/text(8.2 1.6 "{&Delta}=1.42",place(c) size(2) color(black))/*  
*/text(8 1.6 "p-value=0.006",place(c) size(2) color(black)) title("Group B",color(black))

graph combine GroupA GroupB, name(Figure3,replace) row(1) l1("Importance of Political Participation")
graph display Figure3, xsize(9) ysize(5)

************************************************************************************
*                                    Figure 4                                      *
*                                                                                  *            
*Note: This figure illustrates the self-reported beliefs elicited in post-treatment*
*survey. Participants value the importance of earning more than the others based on*
*scale of 1-9, 1 being not important at all, 5 being neutral, and 9 being extremely*
*important. In the Excel file of Figure 4, "Mean" is the experimental results of   *
*the average valuation of the importance of earning more than others. "CI95L" is   *
*lower bound of the 95% confidence interval. "CI95H" is the corresponding higher   *
*bound of the 95% confidence interval. "Treatment" is the Treatment that subjects  *
*are randomly assigned to. "VoterType"=1 means Group A voters' averages;           *
*"VoterType"=2 means Group B voters' averages.                                     *
*These results are manully collected from statistical analysis.                    *                  
*Specifically, these results are generated by using the codes from line 207 to line*
*220 in the associated StatisticsAnalysisReplicationCode.do file.                  *       
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("Figure4") firstrow
twoway (bar Mean Position if VoterType==1,  name(GroupA,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if VoterType==1,lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1))/* 
*/xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny) row(3) label(2 "95% CI"))/*  
*/text(1.5 1 "5.69",place(c) size(8) color(black))/* 
*/text(1.5 2.2 "7.03",place(c) size(8) color(black))/*
*/text(8.2 1.6 "{&Delta}=1.34",place(c) size(2) color(black))/* 
*/text(8 1.6 "p-value=0.006",place(c) size(2) color(black)) title("Group A",color(black))

twoway (bar Mean Position if VoterType==2,  name(GroupB,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if VoterType==2,lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1))/* 
*/xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny) row(3) label(2 "95% CI"))/*  
*/text(1.5 1 "5.10",place(c) size(8) color(black))/* 
*/text(1.5 2.2 "6.40",place(c) size(8) color(black))/*
*/text(8.2 1.6 "{&Delta}=1.30",place(c) size(2) color(black))/*  
*/text(8 1.6 "p-value=0.012",place(c) size(2) color(black)) title("Group B",color(black))

graph combine GroupA GroupB, name(Figure4,replace) row(1) l1("Importance of Earning More than Others")
graph display Figure4, xsize(9) ysize(5)

************************************************************************************
*                                    Figure 5                                      *
*                                                                                  *            
*Note: This figure illustrates the expected likelihood of Policy B winning by      *
*voting game and treatment based on experimental results observed in Experiment 1. * 
*In the Excel file of Figure 5, "Mean" is the experimental results of the estimated*
*likelihood of Policy B winning based on Remark 1 reported in Appendix A. "CI95L"  *
*is lower bound of the 95% confidence interval. "CI95H" is the corresponding higher*
*bound of the 95% confidence interval. "Treatment" is the Treatment that subjects  *
*are randomly assigned to. "VG" is which Voting Game we talk about.                *
*These results are manully collected from statistical analysis.                    *                  
*Specifically, these results are generated by using the codes from line 228 to     *
*line 266 in the associated StatisticsAnalysisReplicationCode.do file.             *       
************************************************************************************

clear
clear
import excel "Figures.xlsx", sheet("Figure5") firstrow
twoway (bar Mean Position if VG==1,  name(GroupA,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if VG==1,lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1))/* 
*/xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(2 "95% CI"))/* 
*/text(0.06 1 "0.28",place(c) size(8) color(black))/* 
*/text(0.06 2.2 "0.38",place(c) size(8) color(black))/* 
*/text(0.47 1.6 "{&Delta}=0.10",place(c) size(2) color(black))/* 
*/text(0.45 1.6 "p-value=0.050",place(c) size(2) color(black)) title("Voting Game 1",color(black))

twoway (bar Mean Position if VG==2,  name(GroupB,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if VG==2,lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1))/* 
*/xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(2 "95% CI"))/* 
*/text(0.06 1 "0.73",place(c) size(8) color(black))/* 
*/text(0.06 2.2 "0.60",place(c) size(8) color(black))/*
*/text(0.82 1.6 "{&Delta}=-0.13",place(c) size(2) color(black))/* 
*/text(0.8 1.6 "p-value=0.038",place(c) size(2) color(black)) title("Voting Game 2",color(black))

graph combine GroupA GroupB, name(Figure5,replace) row(1) l1("Probability of Policy B Winning") 
graph display Figure5, xsize(9) ysize(5)

************************************************************************************
*                                    Figure 6                                      *
*                                                                                  *            
*Note: This figure illustrates the average likelihood of participation by voter    *
*group and experiment.                                                             *
*In the Excel file of Figure 6, "Mean" is the experimental results of average      *
*likelihood of voting. "CI95L" is lower bound of the 95% confidence interval.      *
*"CI95H" is the corresponding higher bound of the 95% confidence interval.         *  
*"Treatment" is the Treatment that subjects are randomly assigned to.              *
*"Experiment" is the experiment that subjects are randomly assigned to.            *
*These results are manully collected from statistical analysis.                    *                  
*Specifically, these results are generated by using the codes from line 631 to     *
*line 687 in the associated StatisticsAnalysisReplicationCode.do file.             *       
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("Figure6") firstrow
twoway (bar Mean Position if Treatment=="Control"&Experiment==1,  name(Control,replace) fcolor(gs4) bcolor(gs14) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(bar Mean Position if Treatment=="Control"&Experiment==2, fcolor(black) bcolor(gs14) lwidth(0.2))/*
*/||(rcap CI95L CI95H Position if Treatment=="Control",lcolor(gs10)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) xlabel(1.5 "Group A" 4.5 "Group B",axis(1))/* 
*/xlabel("",axis(2)) ytitle("") xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(1 2 3) ring(0) position(1) symxsize(Medium)/* 
*/keygap(tiny)  row(3) label(1 "Experiment I") label(2 "Experiment II") label(3 "95% CI"))/* 
*/text(0.04 1 "0.12",place(c) size(5) color(white))/* 
*/text(0.04 2 "0.09",place(c) size(5) color(white))/* 
*/text(0.04 4 "0.35",place(c) size(5) color(white))/* 
*/text(0.04 5 "0.39",place(c) size(5) color(white))/* 
*/text(0.25 1.5 "n.s.",place(c) size(2) color(black))/* 
*/text(0.55 4.5 "n.s.",place(c) size(2) color(black)) title("Control",color(black))

twoway (bar Mean Position if Treatment=="Treatment"&Experiment==1,  name(Treatment,replace) fcolor(gs4) bcolor(gs14) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(bar Mean Position if Treatment=="Treatment"&Experiment==2, fcolor(black) bcolor(gs14) lwidth(0.2))/*
*/||(rcap CI95L CI95H Position if Treatment=="Treatment",lcolor(gs10)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) xlabel(1.5 "Group A" 4.5 "Group B",axis(1))/* 
*/xlabel("",axis(2)) ytitle("") xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(1 2 3) ring(0) position(1) symxsize(Medium)/* 
*/keygap(tiny)  row(3) label(1 "Experiment I") label(2 "Experiment II") label(3 "95% CI"))/* 
*/text(0.04 1 "0.34",place(c) size(5) color(white))/* 
*/text(0.04 2 "0.12",place(c) size(5) color(white))/* 
*/text(0.04 4 "0.54",place(c) size(5) color(white))/* 
*/text(0.04 5 "0.39",place(c) size(5) color(white))/*
*/text(0.52 1.5 "{&Delta}=-0.22",place(c) size(2) color(black))/* 
*/text(0.5 1.5 "p-value<0.001",place(c) size(2) color(black))/*
*/text(0.72 4.5 "{&Delta}=-0.15",place(c) size(2) color(black))/* 
*/text(0.7 4.5 "p-value=0.049",place(c) size(2) color(black)) title("Treatment",color(black))
graph combine Control Treatment, name(Figure6,replace) row(1) l1("Likelihood of Voting")
graph display Figure6, xsize(9) ysize(5)

************************************************************************************
*                                    Figure 7                                      *
*                                                                                  *            
*Note: This figure illustrates the historical data of participation by voter group *                                                                   *
*In the Excel file of Figure 7, "Year" represents the year of historical data.     *
*"WhiteGroup1" is the historical participation rate of White Voters whose age are  *
*between 18 and 24.                                                                *
*"WhiteGroup2" is the historical participation rate of White Voters whose age are  *
*65 years and older.                                                               *
*"BlackGroup1" is the historical participation rate of Black Voters whose age are  *
*between 18 and 24.                                                                *
*"BlackGroup2" is the historical participation rate of Black Voters whose age are  *
*65 years and older.                                                               * 
*These results are manully collected from the data of Current Population Survey,   *
*Voting and Registration Supplements 1968 to Present, historical table A-1.        *
*Publicly available: https://www.census.gov/data/tables/time-series/demo/voting-and-registration/voting-historical-time-series.html.      
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("Figure7") firstrow
twoway (connect BlackGroup1 Year,  name(Black,replace) msymbol(Sh) msize(1.5) mcolor(gs6) lcolor(gs6) xaxis(1 2) yaxis(1 2) )/*
*/||(connect BlackGroup2 Year,  msymbol(S) msize(1.5) mcolor(black) lcolor(black)),/*  
*/ylabel(10 (10) 80,nogrid) ylabel("",axis(2)) xlabel(1964 (4) 1980,axis(1)) xlabel("",axis(2))/* 
*/ytitle("",) xtitle("") xtitle("",axis(2)) legend(order(1 2) ring(0) position(7)/* 
*/symxsize(Medium) keygap(tiny)  row(2) label(1 "18-24 years") label(2 "65 years and over")) title("Black Voters",color(black))

twoway (connect WhiteGroup1 Year,  name(White,replace) msymbol(Sh) msize(1.5) mcolor(gs6) lcolor(gs6) xaxis(1 2) yaxis(1 2) )/*
*/||(connect WhiteGroup2 Year,  msymbol(S) msize(1.5) mcolor(black) lcolor(black)),/*  
*/ylabel(10 (10) 80,nogrid) ylabel("",axis(2)) xlabel(1964 (4) 1980,axis(1)) xlabel("",axis(2))/* 
*/ytitle("",) xtitle("") xtitle("",axis(2))      legend(order(1 2) ring(0) position(7)/* 
*/symxsize(Medium) keygap(tiny)  row(2) label(1 "18-24 years") label(2 "65 years and over")) title("White Voters",color(black))

graph combine Black White, name(Figure7,replace) row(1) l1("Percent of Voting in Presidential Elections")



************************************************************************************
*****************************  Figures in the Appendix  ****************************
************************************************************************************
************************************************************************************
*                              Figures A1 and A2                                   *
*                                                                                  *            
*Note: These figures are produced based on the same code and data of Figure 1.     *
*Specifically, Figure A1 can be produced using the code of this file from line 24  *
*to line 47. Figure A2 can be produced using the code of this file from line 48    *
*to line 58.                                                                       *
************************************************************************************

************************************************************************************
*                                   Figure A3                                      *
*                                                                                  *            
*Note: This figure illustrates the quantal response equilibrium voting behavior in *
*Experiment I. Intrinsic political value is not considered in the calculations!    *
*In the Excel file of Figure A3,                                                   *  
*"Pv" is the quantal reponse equlibrium of a Group A voter's voting for Policy A,  *
*"Qv" is the quantal response equilibrium of a Group B voter's voting for Policy B *
*"Lambda" is the quantal response parameter. The range of Lambda is arbitrarily    *
*set for calculations and illustrations.                                           *
*"VotingGames" reports which voting game the corresponding calculations are for    *
*"Pcom" reports the experimental observation of Group A voters' average            *
*participation in the Treatment                                                    *
*"Qcom" reports the experimental observation of Group B voters' average            *
*participation in the Treatment                                                    *
*"Pno" reports the experimental observation of Group A voters' average             *
*participation in the Control                                                      *
*"Qno" reports the experimental observation of Group B voters' average             *
*participation in the Control                                                      *
*"Pcom" "Qcom" "Pno" "Qno" are manully collected from statistical analysis.        *
*Specifically, these results are generated by using the codes from line 34 to line *
*155 in the associated StatisticsAnalysisReplicationCode.do file.                  *  
*"Pv" "Qv" are manually derived  based on the models reported in Online Appendix C *                                                               *     
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("FigureA3") firstrow
keep if Lambda<=2
tw (line Pv Lambda if VotingGames==1, name(VG1QRE,replace) lcolor(gs2) lwidth(0.5) lpattern(dash) xaxis(1 2) yaxis(1 2))/*
*/||(line Qv Lambda if VotingGames==1, lcolor(gs10) lwidth(0.5))/*
*/||(scatter Pcom Lambda if VotingGames==1,msymbol(Oh) mcolor(red))/*
*/||(scatter Pno Lambda if VotingGames==1,msymbol(Sh) mcolor(red))/*
*/||(scatter Qcom Lambda if VotingGames==1,msymbol(Oh) mcolor(blue))/*
*/||(scatter Qno Lambda if VotingGames==1,msymbol(Sh) mcolor(blue))/*
*/||(pcarrowi 0.95 0.4 0.95 0.25 (3) "{&lambda}=0.239",color(black) barbsize(1.5) mlabcolor(black) mlabsize(3))/*
*/||(pcarrowi 0.7 0.4 0.66 0.26 (1) "Group A (Treatment)",barbsize(1.5) mlabsize(3))/*
*/||(pcarrowi 0.52 0.4 0.48 0.26 (1) "Group A (Control)", barbsize(1.5) mlabsize(3))/*
*/||(pcarrowi 0.45 0.4 0.45 0.26 (3) "Group B (Treatment)", barbsize(1.5) mlabsize(3))/*
*/||(pcarrowi 0.20 0.4 0.24 0.25 (5) "Group B (Control)",barbsize(1.5) mlabsize(3)),/* 
*/ylabel(0 (0.1) 1,nogrid)  xlabel("",axis(2)) ylabel("",axis(2)) xtitle("{&lambda}") xtitle("",axis(2)) ytitle("",axis(2))/* 
*/ytitle("Logit-QRE" "Prob. of Group {it}i Voting for Policy {it}i")/* 
*/legend(region(lcolor(white)) order (1 2) symxsize(6)  label (1 "Group A's Quantal Responses") label( 2 "Group B's Quantal Responses")/*  
*/row(1) position (1) ring(0)) xline(0.239,lcolor(black) lwidth(thin)) title("VG1",color(black))


tw (line Pv Lambda if VotingGames==2, name(VG2QRE,replace) lcolor(gs2) lwidth(0.5) lpattern(dash) xaxis(1 2) yaxis(1 2))/*
*/||(line Qv Lambda if VotingGames==2, lcolor(gs10) lwidth(0.5))/*
*/||(scatter Pcom Lambda if VotingGames==2,msymbol(Oh) mcolor(red))/*
*/||(scatter Pno Lambda if VotingGames==2,msymbol(Sh) mcolor(red))/*
*/||(scatter Qcom Lambda if VotingGames==2,msymbol(Oh) mcolor(blue))/*
*/||(scatter Qno Lambda if VotingGames==2,msymbol(Sh) mcolor(blue))/*
*/||(pcarrowi 0.95 0.4 0.95 0.25 (3) "{&lambda}=0.239",color(black) barbsize(1.5) mlabcolor(black) mlabsize(3))/*
*/||(pcarrowi 0.59 0.4 0.55 0.26 (1) "Group B (Treatment)", barbsize(1.5) mlabsize(3))/*
*/||(pcarrowi 0.41 0.42 0.37 0.28 (1) "Group B (Control)", barbsize(1.5) mlabsize(3))/*
*/||(pcarrowi 0.34 0.44 0.34 0.3 (3) "Group A (Treatment)", barbsize(1.5) mlabsize(3))/*
*/||(pcarrowi 0.20 0.44 0.20 0.3 (3) "Group A (Control)", barbsize(1.5) mlabsize(3)),/* 
*/ylabel(0 (0.1) 1,nogrid)  xlabel("",axis(2)) ylabel("",axis(2)) xtitle("{&lambda}") xtitle("",axis(2)) ytitle("",axis(2))/* 
*/ytitle("Logit-QRE" "Prob. of Group {it}i Voting for Policy {it}i")/* 
*/legend(region(lcolor(white)) order (1 2) symxsize(6)  label (1 "Group A") label( 2 "Group B")/*  
*/row(2) position (1) ring(0)) xline(0.239,lcolor(black) lwidth(thin)) title("VG2",color(black))

grc1leg VG1QRE VG2QRE, name(FigureA3,replace) position(6) ring(1) row(1)

************************************************************************************
*                                   Figure A4                                      *
*                                                                                  *            
*Note: This figure illustrates the quantal response equilibrium voting behavior in *
*Experiment I. Intrinsic political value is considered in the calculations!        *
*In the Excel file of Figure A3,                                                   *  
*"Pv" is the quantal reponse equlibrium of a Group A voter's voting for Policy A,  *
*"Qv" is the quantal response equilibrium of a Group B voter's voting for Policy B *
*"Lambda" is the quantal response parameter. The range of Lambda is arbitrarily    *
*set for calculations and illustrations.                                           *
*"VotingGames" reports which voting game the corresponding calculations are for    *
*"Competition"=NO means the Control Group; "Competition"=YES means the Treatment   * 
*"Pcom" reports the experimental observation of Group A voters' average            *
*participation in the Treatment                                                    *
*"Qcom" reports the experimental observation of Group B voters' average            *
*participation in the Treatment                                                    *
*"Pno" reports the experimental observation of Group A voters' average             *
*participation in the Control                                                      *
*"Qno" reports the experimental observation of Group B voters' average             *
*participation in the Control                                                      *
*"Pcom" "Qcom" "Pno" "Qno" are manully collected from statistical analysis.        *
*Specifically, these results are generated by using the codes from line 34 to line *
*155 in the associated StatisticsAnalysisReplicationCode.do file.                  *  
*"Pv" "Qv" are manually derived  based on the models reported in Online Appendix C *                                                               *     
************************************************************************************
clear
import excel "Figures.xlsx", sheet("FigureA4") firstrow
tw (line Pv Lambda if Competition=="NO"&VotingGames==1, name(VG1QREi,replace) lcolor(gs2) lwidth(0.5) lpattern(dash) xaxis(1 2) yaxis(1 2))/*
*/||(line Qv Lambda if Competition=="NO"&VotingGames==1, lcolor(gs2) lwidth(0.5))/*
*/||(line Pv Lambda if Competition=="YES"&VotingGames==1, lcolor(gs10) lwidth(0.5) lpattern(dash) xaxis(1 2) yaxis(1 2))/*
*/||(line Qv Lambda if Competition=="YES"&VotingGames==1, lcolor(gs10) lwidth(0.5))/*
*/||(scatter Pcom Lambda if VotingGames==1,msymbol(Oh) mcolor(gs10))/*
*/||(scatter Pno Lambda if VotingGames==1,msymbol(Sh) mcolor(gs2))/*
*/||(scatter Qcom Lambda if VotingGames==1,msymbol(Oh) mcolor(gs10))/*
*/||(scatter Qno Lambda if VotingGames==1,msymbol(Sh) mcolor(gs2))/*
*/||(pcarrowi 0.95 0.4 0.95 0.25 (3) "{&lambda}=0.239",color(black) barbsize(1.5) mlabcolor(black) mlabsize(3))/*
*/||(pcarrowi 0.75 0.4 0.66 0.26 (1) "Group A (Treatment)",barbsize(1.5) mlabsize(2))/*
*/||(pcarrowi 0.52 0.4 0.48 0.26 (1) "Group A (Control)",barbsize(1.5) mlabsize(2))/*
*/||(pcarrowi 0.45 0.4 0.45 0.26 (3) "Group B (Treatment)",barbsize(1.5) mlabsize(2))/*
*/||(pcarrowi 0.22 0.4 0.25 0.28 (3) "Group B (Control)",barbsize(1.5) mlabsize(2)),/* 
*/ylabel(0 (0.1) 1,nogrid)  xlabel("",axis(2)) ylabel("",axis(2)) xtitle("{&lambda}") xtitle("",axis(2)) ytitle("",axis(2))/* 
*/ytitle("Logit-QRE" "Prob. of Group {it}i Voting for Policy {it}i")/* 
*/legend(region(lcolor(white)) order (1 2 3 4) symxsize(6)/*  
*/label (1 "Group A (Control)") label( 2 "Group B (Control)") label (3 "Group A (Treatment)") label(4 "Group B (Treatment)")  row(2) position (1) ring(0) size(small))/* 
*/xline(0.239,lcolor(black) lwidth(thin)) title("VG1",color(black)) 

tw (line Pv Lambda if Competition=="NO"&VotingGames==2, name(VG2QREi,replace) lcolor(gs2) lwidth(0.5) lpattern(dash) xaxis(1 2) yaxis(1 2))/*
*/||(line Qv Lambda if Competition=="NO"&VotingGames==2, lcolor(gs2) lwidth(0.5))/* 
*/||(line Pv Lambda if Competition=="YES"&VotingGames==2, lcolor(gs10) lwidth(0.5) lpattern(dash) xaxis(1 2) yaxis(1 2))/*
*/||(line Qv Lambda if Competition=="YES"&VotingGames==2, lcolor(gs10) lwidth(0.5))/*
*/||(scatter Pcom Lambda if VotingGames==2,msymbol(Oh) mcolor(gs10))/*
*/||(scatter Pno Lambda if VotingGames==2,msymbol(Sh) mcolor(gs2))/*
*/||(scatter Qcom Lambda if VotingGames==2,msymbol(Oh) mcolor(gs10))/*
*/||(scatter Qno Lambda if VotingGames==2,msymbol(Sh) mcolor(gs2))/*
*/||(pcarrowi 0.95 0.4 0.95 0.25 (3) "{&lambda}=0.239",color(black) barbsize(1.5) mlabcolor(black) mlabsize(3))/*
*/||(pcarrowi 0.59 0.4 0.55 0.26 (1) "Group B (Treatment)",barbsize(1.5) mlabsize(2))/*
*/||(pcarrowi 0.41 0.42 0.37 0.28 (1) "Group B (Control)",barbsize(1.5) mlabsize(2) )/*
*/||(pcarrowi 0.34 0.44 0.34 0.3 (3) "Group A (Treatment)",barbsize(1.5) mlabsize(2))/*
*/||(pcarrowi 0.20 0.44 0.20 0.3 (3) "Group A (Control)",barbsize(1.5) mlabsize(2)),/* 
*/ylabel(0 (0.1) 1,nogrid)  xlabel("",axis(2)) ylabel("",axis(2)) xtitle("{&lambda}") xtitle("",axis(2)) ytitle("",axis(2))/* 
*/ytitle("Logit-QRE" "Prob. of Group {it}i Voting for Policy {it}i")/* 
*/legend(region(lcolor(white)) order (1 2 3 4) symxsize(6)  label (1 "Group A (Control)") label( 2 "Group B (Control)") label (3 "Group A (Treatment)") label(4 "Group B (Treatment)")/*  
*/row(1) position (1) ring(0)) xline(0.239,lcolor(black) lwidth(thin)) title("VG2",color(black)) 
grc1leg VG1QREi VG2QREi, name(FigureA4,replace) position(6) ring(1) row(1)



************************************************************************************
*                                   Figure A5                                      *
*                                                                                  *            
*Note: This figure illustrates the observed likelihood of participation by group,  *
*treatment, and voting game. All these observations are the results of Exp. III    *
*In the Excel file of Figure A5, "Mean" is the experimental results of the average *
*participation. "CI95L" is the corresponding lower bound of the 95% confidence     *
*interval. "CI95H" is the corresponding higher bound of the 95% confidence interval*
*"Conditions" is the Treatment that subjects are randomly assigned to              *
*These results are manully collected from statistical analysis.                    *
*Specifically, these results are generated by using the codes from line 765 to     *
*line 865 in the associated StatisticsAnalysisReplicationCode.do file.             *       
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("FigureA5") firstrow
twoway (bar Mean Position if VotingGames==1&Conditions=="Control",  name(AppVG1,replace) fcolor(gs4) bcolor(gs14) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(bar Mean Position if VotingGames==1&Conditions=="Treatment", fcolor(black) bcolor(gs14) lwidth(0.2))/*
*/||(rcap CI95L CI95H Position if VotingGames==1,lcolor(gs10)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) xlabel(1.5 "Group A" 4.5 "Group B",axis(1)) xlabel("",axis(2)) ytitle("") xtitle("") xtitle("",axis(2))/*      
*/legend(order(1 2 3) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(1 "Control") label(2 "Treatment") label(3 "95% CI"))/* 
*/text(0.05 1 "0.43",place(c) size(4) color(white))/* 
*/text(0.05 2 "0.67",place(c) size(4) color(white))/* 
*/text(0.05 4 "0.19",place(c) size(4) color(white))/* 
*/text(0.05 5 "0.46",place(c) size(4) color(white))/* 
*/text(0.8 1.5 "p-value=0.028",place(c) size(2) color(black))/* 
*/text(0.6 4.5 "p-value=0.009",place(c) size(2) color(black)) title("VG1",color(black))

twoway (bar Mean Position if VotingGames==2&Conditions=="Control",  name(AppVG2,replace) fcolor(gs4) bcolor(gs14) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(bar Mean Position if VotingGames==2&Conditions=="Treatment", fcolor(black) bcolor(gs14) lwidth(0.2))/*
*/||(rcap CI95L CI95H Position if VotingGames==2,lcolor(gs10)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) xlabel(1.5 "Group A" 4.5 "Group B",axis(1)) xlabel("",axis(2)) ytitle("") xtitle("") xtitle("",axis(2))/*      
*/legend(order(1 2 3) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(1 "Control") label(2 "Treatment") label(3 "95% CI"))/*  
*/text(0.05 1 "0.10",place(c) size(4) color(white))/* 
*/text(0.05 2 "0.35",place(c) size(4) color(white))/* 
*/text(0.05 4 "0.31",place(c) size(4) color(white))/* 
*/text(0.05 5 "0.58",place(c) size(4) color(white))/* 
*/text(0.5 1.5 "p-value=0.033",place(c) size(2) color(black))/* 
*/text(0.7 4.5 "p-value=0.025",place(c) size(2) color(black)) title("VG2",color(black))


twoway (bar Mean Position if VotingGames==3&Conditions=="Control",  name(AppVG3,replace) fcolor(gs4) bcolor(gs14) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(bar Mean Position if VotingGames==3&Conditions=="Treatment", fcolor(black) bcolor(gs14) lwidth(0.2))/*
*/||(rcap CI95L CI95H Position if VotingGames==3,lcolor(gs10)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(0 (0.2) 1,nogrid) ylabel("",axis(2)) xlabel(1.5 "Group A" 4.5 "Group B",axis(1)) xlabel("",axis(2)) ytitle("") xtitle("") xtitle("",axis(2))/*      
*/legend(order(1 2 3) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(1 "Control") label(2 "Treatment") label(3 "95% CI"))/* 
*/text(0.05 1 "0.25",place(c) size(4) color(white))/* 
*/text(0.05 2 "0.58",place(c) size(4) color(white))/* 
*/text(0.05 4 "0.12",place(c) size(4) color(white))/* 
*/text(0.05 5 "0.36",place(c) size(4) color(white))/* 
*/text(0.8 1.5 "p-value=0.020",place(c) size(2) color(black))/* 
*/text(0.7 4.5 "p-value=0.050",place(c) size(2) color(black)) title("VG3",color(black))

graph combine AppVG1 AppVG2 AppVG3, name(FigureA5,replace) row(1) l1("Likelihood of Voting")
graph display FigureA5, xsize(15) ysize(6)

************************************************************************************
*                                    Figure A6                                     *
*                                                                                  *            
*Note: This figure illustrates the self-reported beliefs elicited in post-treatment*
*survey in Experiment III. Participants value the importance of participation      * 
*based on a scale of 1-9: 1 being not important at all, 5 being neutral, and 9     *
*being extremely important                                                         *          
*In the Excel file of Figure A6, "Mean" is the experimental results of the average *
*valuation of the importance of participation. "CI95L" is lower bound of the 95%   * 
*confidence interval. "CI95H" is the corresponding higher bound of the 95%         *
*confidence interval.                                                              *  
*"Conditions" is the Treatment that subjects  are randomly assigned to.            *
*These results are manully collected from statistical analysis.                    *                  
*Specifically, these results are generated by using the codes from line 880 to     *
*line 884 in the associated StatisticsAnalysisReplicationCode.do file.             *       
************************************************************************************

clear
clear
import excel "Figures.xlsx", sheet("FigureA6") firstrow
twoway (bar Mean Position if Group=="A",  name(GroupA,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if Group=="A",lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1)) xlabel("",axis(2))/* 
*/ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(2 "95% CI"))/*  
*/text(1.5 1 "4.33",place(c) size(6) color(black))/* 
*/text(1.5 2.2 "6.75",place(c) size(6) color(black))/* 
*/text(8 1.6 "p-value=0.027",place(c) size(2) color(black)) title("Group A",color(black))

twoway (bar Mean Position if Group=="B",  name(GroupB,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if Group=="B",lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1)) xlabel("",axis(2))/* 
*/ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(2 "95% CI"))/* 
*/text(1.5 1 "4.89",place(c) size(6) color(black))/* 
*/text(1.5 2.2 "6.78",place(c) size(6) color(black))/* 
*/text(8 1.6 "p-value=0.012",place(c) size(2) color(black)) title("Group B",color(black))

graph combine GroupA GroupB, name(FigureA5,replace) row(1) l1("Importance of Political Participation")


************************************************************************************
*                                    Figure A7                                     *
*                                                                                  *            
*Note: This figure illustrates the self-reported beliefs elicited in post-treatment*
*survey in Experiment III. Participants value the importance of participation      * 
*based on a scale of 1-9: 1 being not important at all, 5 being neutral, and 9     *
*being extremely important                                                         *          
*In the Excel file of Figure A7, "Mean" is the experimental results of the average *
*valuation of the importance of earning more than the others.                      *
*"CI95L" is lower bound of the 95% confidence interval.                            *
*"CI95H" is the corresponding higher bound of the 95%confidence interval.          *  
*"Conditions" is the Treatment that subjects  are randomly assigned to.            *
*These results are manully collected from statistical analysis.                    *                  
*Specifically, these results are generated by using the codes from line 886 to     *
*line 890 in the associated StatisticsAnalysisReplicationCode.do file.             *       
************************************************************************************

clear
clear
import excel "Figures.xlsx", sheet("FigureA7") firstrow
twoway (bar Mean Position if Group=="A",  name(GroupA,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if Group=="A",lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1)) xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(2 "95% CI"))/*  
*/text(1.5 1 "5.75",place(c) size(6) color(black))/* 
*/text(1.5 2.2 "7.58",place(c) size(6) color(black))/* 
*/text(8 1.6 "p-value=0.021",place(c) size(2) color(black)) title("Group A",color(black))

twoway (bar Mean Position if Group=="B",  name(GroupB,replace) fcolor(gs14) bcolor(gs2) lwidth(0.2) xaxis(1 2) yaxis(1 2) )/*
*/||(rcap CI95L CI95H Position if Group=="B",lcolor(gs2)  yaxis(1) lwidth(0.2)),/*  
*/ylabel(1 (2) 9,nogrid) ylabel("",axis(2)) xlabel(1 "Control" 2.2 "Treatment",axis(1)) xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(2) ring(0) position(1) symxsize(Medium) keygap(tiny)  row(3) label(2 "95% CI"))/*  
*/text(1.5 1 "4.67",place(c) size(6) color(black))/* 
*/text(1.5 2.2 "6.83",place(c) size(6) color(black))/* 
*/text(8 1.6 "p-value=0.005",place(c) size(2) color(black)) title("Group B",color(black))

graph combine GroupA GroupB, name(FigureA7,replace) row(1) l1("Importance of Earning More than Others")

************************************************************************************
*                                   Figure A8                                      *
*                                                                                  *            
*Note: This figure illustrates the historical data of participation by voter group * 
*In the Excel file of Figure A8, "Year" represents the year of historical data.    *
*"WhiteGroup1" is the historical participation rate of White Voters whose age are  *
*between 18 and 24.                                                                *
*"WhiteGroup2" is the historical participation rate of White Voters whose age are  *
*65 years and older.                                                               *
*"WhiteGroup3" is the historical participation rate of White Voters whose age are  *
*between 25 and 44.                                                                *
*"WhiteGroup4" is the historical participation rate of White Voters whose age are  *
*between 45 and 64.                                                                *
*"BlackGroup1" is the historical participation rate of Black Voters whose age are  *
*between 18 and 24.                                                                *
*"BlackGroup2" is the historical participation rate of Black Voters whose age are  *
*65 years and older.                                                               *
*"BlackGroup3" is the historical participation rate of Black Voters whose age are  *
*between 25 and 44.                                                                *
*"BlackGroup4" is the historical participation rate of Black Voters whose age are  *
*between 45 and 64.                                                                * 
*These results are manully collected from the data of Current Population Survey,   *
*Voting and Registration Supplements 1968 to Present, historical table A-1.        *
*Publicly available: https://www.census.gov/data/tables/time-series/demo/voting-and-registration/voting-historical-time-series.html.      
************************************************************************************
clear
clear
import excel "Figures.xlsx", sheet("FigureA8") firstrow
twoway (connect BlackGroup1 Year,  name(Black,replace) msymbol(Sh) msize(1.5) mcolor(gs6) lcolor(gs6) xaxis(1 2) yaxis(1 2) )/*
*/||(connect BlackGroup3 Year,  msymbol(T) msize(1.5) mcolor(gs10) lcolor(gs10) lpattern(dash))/*
*/||(connect BlackGroup4 Year,  msymbol(O) msize(1.5) mcolor(gs14) lcolor(gs14))/*
*/||(connect BlackGroup2 Year,  msymbol(S) msize(1.5) mcolor(black) lcolor(black)),/*  
*/ylabel(10 (10) 80,nogrid) ylabel("",axis(2)) xlabel(1964 (4) 1980,axis(1)) xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(1 2 3 4) ring(0) position(7) symxsize(Medium) keygap(tiny)/*  
*/col(1) label(1 "18-24 years") label(2 "25-44 years") label(3 "45-64 years") label(4 "65 years and over")) title("Black Voters",color(black))

twoway (connect WhiteGroup1 Year,  name(White,replace) msymbol(Sh) msize(1.5) mcolor(gs6) lcolor(gs6) xaxis(1 2) yaxis(1 2) )/*
*/||(connect WhiteGroup3 Year,  msymbol(T) msize(1.5) mcolor(gs10) lcolor(gs10) lpattern(dash))/*
*/||(connect WhiteGroup4 Year,  msymbol(O) msize(1.5) mcolor(gs14) lcolor(gs14))/*
*/||(connect WhiteGroup2 Year,  msymbol(S) msize(1.5) mcolor(black) lcolor(black)),/*  
*/ylabel(10 (10) 80,nogrid) ylabel("",axis(2)) xlabel(1964 (4) 1980,axis(1)) xlabel("",axis(2)) ytitle("",) xtitle("") xtitle("",axis(2))/*      
*/legend(region(lcolor(white))  order(1 2 3 4) ring(0) position(7) symxsize(Medium) keygap(tiny)/*  
*/col(1) label(1 "18-24 years") label(2 "25-44 years") label(3 "45-64 years") label(4 "65 years and over")) title("White Voters",color(black))

graph combine Black White, name(FigureA8,replace) row(1) l1("Percent of Voting in Presidential Elections")
